//处理新增文章
const db=require("../lib/db")

function addArticle(title,content,desc,author,authorId,classify){
    return new Promise((resolve,reject)=>{
        let sql=`insert into main(title,content,descs,author,authorId,classify)values('${title}','${content}','sss','${author}',${authorId},'${classify}')`;
        console.log(sql)
        db.querySql(sql).then(data=>{
            if(data.length==0){
                resolve(404)
            }else{
                console.log(true)
                resolve(true)
            }
        })
    })
}

module.exports=addArticle